﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CanDoo.Core.Data;
using CanDoo.Data;
using CanDoo.Admin.Core.Models;
using System.ComponentModel.DataAnnotations.Schema;

namespace CanDoo.Oil.Core.Models
{
    /// <summary>
    /// 实体类——取油码
    /// </summary>
    [Serializable]
    [Description("取油码")]
    public class GetOilCode :  EntityBase,ICreatedTime, IAudited
    {
        /// <summary>
        ///所属客户
        /// </summary>
        [Display(Name = "所属客户")]
        public virtual Customer Customer { get; set; }
        /// <summary>
        ///所属客户外键
        /// </summary>
        [Display(Name = "所属客户外键")]
        public long CustomerId { get; set; }

        /// <summary>
        ///油品
        /// </summary>
        [Display(Name = "油品")]
        public virtual Product Oil { get; set; }
        /// <summary>
        ///油品外键
        /// </summary>
        [Display(Name = "油品外键")]
        public long OilId { get; set; }

        /// <summary>
        ///数量
        /// </summary>
        [Display(Name = "数量")]
        [Required]
        public double Num { get; set; }

        /// <summary>
        ///单价
        /// </summary>
        [Display(Name = "单价")]
        [Required]
        public double Price { get; set; }

        /// <summary>
        ///金额
        /// </summary>
        [Display(Name = "金额")]
        [Required]
        public double Money { get; set; }

        /// <summary>
        ///取油码
        /// </summary>
        [Display(Name = "取油码")]
        [Required, StringLength(50)]
        [Index(IsUnique =true)]
        public string OilCode { get; set; }

        /// <summary>
        ///使用量
        /// </summary>
        [Display(Name = "使用量")]
        [Required]
        public double Used { get; set; }

        /// <summary>
        ///剩余量
        /// </summary>
        [Display(Name = "剩余量")]
        [Required]
        public double Lasted { get; set; }

        /// <summary>
        /// 取油机器
        /// </summary>
        public string StoreNo { get; set; }

        
        #region Implementation of ICreatedTime

        /// <summary>
        /// 获取设置 信息创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        public DateTime CreatedTime { get; set; }
        #endregion

        #region Implementation of ICreatedAudited

        /// <summary>
        /// 获取或设置 创建者编号
        /// </summary>
        [Display(Name = "创建人")]
        public string CreatorUserId { get; set; }

        #endregion

        #region Implementation of IUpdateAutited

        /// <summary>
        /// 获取或设置 最后更新时间
        /// </summary>
        [Display(Name = "最后更新时间")]
        public DateTime? LastUpdatedTime { get; set; }

        /// <summary>
        /// 获取或设置 最后更新者编号
        /// </summary>
        [Display(Name = "最后更新用户")]
        public string LastUpdatorUserId { get; set; }

        #endregion
    }
}
